#ifndef  INFOMATCONFIGDEFINE_H_
#define  INFOMATCONFIGDEFINE_H_

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;

const uint8_t INFOMAT_CONFIG_PROTOCOL = 0xD1;

const uint8_t INFOMAT_TYPE_IP = 1;
const uint8_t INFOMAT_TYPE_MAC = 2;
const uint8_t INFOMAT_TYPE_LAYOUT = 3;
const uint8_t INFOMAT_TYPE_VERSION = 4;
const uint8_t INFOMAT_TYPE_DELETE_FILE = 5;
const uint8_t INFOMAT_TYPE_VOLUME = 6;
const uint8_t INFOMAT_TYPE_TIMEOUT = 7;
const uint8_t INFOMAT_TYPE_SCREENMODE = 8;

const uint8_t INFOMAT_RESULT_OK = 0;
const uint8_t INFOMAT_RESULT_ERR = 1;

const uint8_t INFOMAT_COMMAND_WRITE = 1;
const uint8_t INFOMAT_COMMAND_READ = 2;
const uint8_t INFOMAT_COMMAND_DELETE_HTML = 3;
const uint8_t INFOMAT_COMMAND_DELETE_MOVIE = 4;

#pragma pack(push,2)

/**
 *@param    protocol: INFOMAT_CONFIG_PROTOCOL  (0xF9,0xE2 defined by ChenHuiting)
 *@param    type    : INFOMAT_TYPE_IP...
 *@param    size    : size of the TYPE structure.
 *@param    command : INFOMAT_COMMAND_WRITE/ INFOMAT_COMMAND_READ
 *@param    result  : INFOMAT_RESULT_OK/ INFOMAT_RESULT_ERR
 */
struct STInfomatConfigHead
{
    uint8_t protocol;
    uint8_t type;
    uint16_t size;
    uint8_t result;
    uint8_t command;
}__attribute__((__packed__));

struct STInfomatIpType
{
    STInfomatConfigHead head;
    uint32_t ip;
    uint32_t netmask;
    uint32_t gateway;
}__attribute__((__packed__));

struct STInfomatMacType
{
    STInfomatConfigHead head;
    uint8_t mac[6];
}__attribute__((__packed__));

struct STInfomatLayoutType
{
    STInfomatConfigHead head;
    uint8_t layoutNo;
}__attribute__((__packed__));

struct STInfomatVersionType
{
    STInfomatConfigHead head;
    uint8_t major;
    uint8_t minor;
    uint8_t release;
    uint8_t build;
}__attribute__((__packed__));

struct STInfomatVolumeType
{
    STInfomatConfigHead head;
    uint8_t volume;
}__attribute__((__packed__));

struct STInfomatTimeout     // 22Feb2011
{
    STInfomatConfigHead head;
    uint8_t timeout;
}__attribute__((__packed__));

struct STInfomatScreenMode  // 22Feb2011
{
    STInfomatConfigHead head;
    uint8_t screenMode;
}__attribute__((__packed__));

#pragma pack(pop)
#endif /*-- INFOMATCONFIGDEFINE_H_ ----*/
